package com.qcu.controller.admin;

import com.qcu.dto.chart.AppointOfDoctor;
import com.qcu.dto.chart.HotProduct;
import com.qcu.dto.chart.UserGoodCount;
import com.qcu.service.AppointmentService;
import com.qcu.service.OrderInfoService;
import com.qcu.service.PostService;
import com.qcu.util.Response;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Name: MyComputer
 * @ClassName ChartController
 * @Description:
 * @date 2025/4/13 22:56
 */
@RestController
@RequestMapping("/admin/chart")
public class ChartController {

    @Resource
    AppointmentService appointmentService;

    @Resource
    OrderInfoService orderInfoService;

    @Resource
    PostService postService;

    @GetMapping("/appointInfo")
    public Response getAppoOfDoct(){
        List<AppointOfDoctor> appointOfDoctor = appointmentService.getAppoOfDoct();
        return Response.success(appointOfDoctor);
    }

    @GetMapping("/hotProduct")
    public Response getHotProduct(){
        List<HotProduct> hotProduct = orderInfoService.getHotProduct();
        return Response.success(hotProduct);
    }

    @GetMapping("/topUserGoodCounts")
    public Response getTopUserGoodCounts() {
        List<UserGoodCount> topUserGoodCounts = postService.getTopUserGoodCounts();
        return Response.success(topUserGoodCounts);
    }

}
